<style type="text/css">
	body {
		background: url(img/login.png)  no-repeat center center !important;background-size: cover;
	}
</style>
<!--<img src="img/logo1.png" alt="" id="logo" />-->
<div id="login" class="allCenter">
	<h2>登录佰睿盈社区</h2>
	<p>寻找智慧信号，成就交易大师</p>

	<div class="box">

		<div id="tap">
			<a href="###" class="active">账号登录</a>
			<a href="###" id="accountZc">账号注册</a>
			<input type="text" placeholder="账    号：" id="lusername" />
			<br />

			<input type="password" placeholder="密    码：" id="lpassword" />
			<br />
			<input type="checkbox" id="rember" /><span>记住密码</span>
			<a href="###" id="fogetPass">忘记密码？</a>
			<button id="logOn" ng-click="onlogin()">登   录</button>
		</div>
		<div id="tap2" style="display: none;">
			<a href="###" id="account">账号登录</a>
			<a href="###" class="active">账号注册</a>
			<br />

			<input type="text" placeholder="输入邮箱：" style="width: 267px;" id="zemail" />
			<button style="width: 118px;border-radius: 10px;margin-left: 10px;" id="zc_getCodeBtn">获取验证码</button>
			<br />
			<input type="text" placeholder="输入验证码：" id="zcode" />
			<br />
			<input type="password" placeholder="输入密码：" id="zpassword" />
			<br />
			<input type="password" placeholder="确认密码：" id="zpassword2" />
			<br />
			<button ng-click="onzc()">确  定</button>
		</div>
		<div id="tap3" style="display: none;">

			<a href="###" class="active">重置密码</a>
			<br />

			<input type="text" placeholder="输入邮箱：" style="width: 267px;" id="femail" />
			<button style="width: 118px;border-radius: 10px;margin-left: 10px;" id="foget_getCodeBtn">获取验证码</button>
			<br />
			<input type="text" placeholder="输入验证码：" id="fcode" />
			<br />
			<input type="password" placeholder="输入密码：" id="fpassword" />
			<br />
			<input type="password" placeholder="确认密码：" id="fpassword2" />
			<br />
			<button id="onChangePass">确  定</button>
		</div>
	</div>

</div>
<script type="text/javascript">
	$('body').height($(window).height());
	$(window).resize(function() {
		$('body').height($(window).height());

	})
	$(function() {

		$("#accountZc").on("click", function() {
			$("#tap").hide();
			$("#tap2").show();

		});
		$("#account").on("click", function() {
			$("#tap2").hide();
			$("#tap").show();

		});

		$("#fogetPass").on("click", function() {
			$("#tap").hide();
			$("#tap3").show();

		});
		var zcBol = true;
		$('#zc_getCodeBtn').on("click", function() {

			if($('#zemail').val() == "") {
				prompt("邮箱不能为空")

			} else if(emailGe($('#zemail').val()) == false) {
				return false;
			} else {
				zcBol = setTime($('#zemail').val(), $('#zc_getCodeBtn'), zcBol)

			}

		})

		var fBol = true;
		$('#foget_getCodeBtn').on("click", function() {

			if($('#femail').val() == "") {
				prompt("邮箱不能为空")

			} else if(!emailGe($('#femail').val()) == false) {
				return false;
			} else {
				fBol = setTime($('#femail').val(), $('#foget_getCodeBtn'), fBol, "/wechat_mt5/user/forget/pwd/send/mail", "get")

			}

		})
		$('#onChangePass').on("click", function() {

			if($('#fpassword').val() == "") {
				prompt("请输入新密码!");
			} else if($('#fpassword').val() != $('#fpassword2').val()) {
				prompt("确认密码错误!");
			} else if($('#femail').val() == "") {
				prompt("邮箱不能为空!");
			} else if($('#fcode').val() == "") {
				prompt("验证码不能为空!");
			} else if(emailGe($('#femail').val()) == false) {
				return false;
			} else if($('#fpassword').val().length < 6 || $('#fpassword').val().length > 16) {
				mui.alert("密码长度6到16位之间！")
			} else {

				$.ajax({
					type: "post",
					url: "/wechat_mt5/user/forget/pwd",
					data: {

						newPassword: $('#fpassword').val(),
						mail: $('#femail').val(),
						mailValidationCode: $('#fcode').val(),

					},
					success: function(data) {

						if(data.code == 0) {
							if(data.data) {
								window.location.reload();
								prompt("恭喜您修改成功！");
								

							} else {
								prompt("修改失败，请重新修改！");
							}
						} else if(data.code == 10010007) {
							prompt("修改失败，验证码错误！");
						}

					},
					error: function(data) {

					}
				});
			}

		})

	});
</script>